#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int a, b;
	while (scanf("%d%d", &a, &b) != EOF)
	{
		int i = (a < b) ? a : b;
		int j = i;
		for (j; j > 0; j--)
		{
			if (a % j == 0 && b % j == 0)
			{
				break;
			}
		}
		printf("%d\n", j);
	}
	return 0;
}